/**
{
    "each": "432006",   //订单id
    "trembling": "2",
    "bending": 2,
    "tossing": "Super Prestamo",   //【重要】 产品名称
    "griesbach": "http://super.png",//【重要】 产品logo
    "fallals": "120",  //订单状态
    "standing": "2021-10-14",
    "everlasting": "Harap bayar tepat waktu",
    "earnestly": "Bayar Segera",   //【重要】状态名称
    "better": "Menunggu pembayaran",    //该笔订单的描述
    "anything": "Rp 2.000.000",   //借款金额
    "lover": "http://47.89.212.157:8080/#/confirmOfLoanV3?orderId=432006&productId=2",   //【重要】跳转地址
    "call": "http://47.89.212.157:8080/#/confirmOfLoanV3?orderId=432006&productId=2",
    "zealous": "Repayment Date",//日期文案
    "gathered": "Repayment Amount",//额度文案
    "stuff": "08-09-2022", //展期日期
    "armful": 0, //逾期天数
    "enormous": 1, //是否放款
    "carried": "29-12-2020",   //借款时间
    "burden": "12-01-2021",    //应还时间
    "heart": "91 Hari"   //借款期限
    "wrapped": [   //【重要】 订单列表显示数据 直接遍历下方数据就行，左右结构展示
    {
    "discernible": "Loan Amount",  //标题
    "hedge": "₹ 2000"   //值
    },
    {
    "discernible": "Loan Term",
    "hedge": "91 Days"
    },
    {
    "discernible": "application time",
    "hedge": "July 05, 2023"
    },
    {
    "discernible": "due time",
    "hedge": "October 04, 2023"
    }
    ],
    "growths": "View Loan Agreement",  //【重要】借款协议 展示文案  为空不显示
    "rank": "https://scb.britexfinancialspl.com/bee/yeah/frightente?putter=SBI20230705144
    }
 */

class DnpOrderListModel {
  /// 订单id
  String? each;
  String? trembling;
  int? bending;
  
  /// 产品名称
  String? tossing;
  
  /// 产品logo
  String? griesbach;
  
  /// 订单状态
  String? fallals;
  String? standing;
  String? everlasting;
  
  /// 状态名称
  String? earnestly;
  
  /// 该笔订单的描述
  String? better;
  
  /// 借款金额
  String? anything;
  
  /// 跳转地址
  String? lover;
  String? call;
  
  /// 日期文案
  String? zealous;
  
  /// 额度文案
  String? gathered;
  
  /// 展期日期
  String? stuff;
  
  /// 逾期天数
  int? armful;
  
  /// 是否放款
  int? enormous;
  
  /// 借款时间
  String? carried;
  
  /// 应还时间
  String? burden;
  
  /// 借款期限
  String? heart;
  
  /// 订单列表显示数据
  List<DnpOrderListItemModel>? wrapped;
  
  /// 借款协议展示文案 为空不显示
  String? growths;
  String? rank;

  DnpOrderListModel({
    this.each,
    this.trembling,
    this.bending,
    this.tossing,
    this.griesbach,
    this.fallals,
    this.standing,
    this.everlasting,
    this.earnestly,
    this.better,
    this.anything,
    this.lover,
    this.call,
    this.zealous,
    this.gathered,
    this.stuff,
    this.armful,
    this.enormous,
    this.carried,
    this.burden,
    this.heart,
    this.wrapped,
    this.growths,
    this.rank,
  });

  factory DnpOrderListModel.fromJson(Map<String, dynamic> json) {
    return DnpOrderListModel(
      each: json['each']?.toString(),
      trembling: json['trembling']?.toString(),
      bending: json['bending'] is int ? json['bending'] : int.tryParse(json['bending']?.toString() ?? ''),
      tossing: json['tossing']?.toString(),
      griesbach: json['griesbach']?.toString(),
      fallals: json['fallals']?.toString(),
      standing: json['standing']?.toString(),
      everlasting: json['everlasting']?.toString(),
      earnestly: json['earnestly']?.toString(),
      better: json['better']?.toString(),
      anything: json['anything']?.toString(),
      lover: json['lover']?.toString(),
      call: json['call']?.toString(),
      zealous: json['zealous']?.toString(),
      gathered: json['gathered']?.toString(),
      stuff: json['stuff']?.toString(),
      armful: json['armful'] is int ? json['armful'] : int.tryParse(json['armful']?.toString() ?? ''),
      enormous: json['enormous'] is int ? json['enormous'] : int.tryParse(json['enormous']?.toString() ?? ''),
      carried: json['carried']?.toString(),
      burden: json['burden']?.toString(),
      heart: json['heart']?.toString(),
      wrapped: json['wrapped'] != null
          ? (json['wrapped'] as List).map((item) => DnpOrderListItemModel.fromJson(item)).toList()
          : null,
      growths: json['growths']?.toString(),
      rank: json['rank']?.toString(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'each': each,
      'trembling': trembling,
      'bending': bending,
      'tossing': tossing,
      'griesbach': griesbach,
      'fallals': fallals,
      'standing': standing,
      'everlasting': everlasting,
      'earnestly': earnestly,
      'better': better,
      'anything': anything,
      'lover': lover,
      'call': call,
      'zealous': zealous,
      'gathered': gathered,
      'stuff': stuff,
      'armful': armful,
      'enormous': enormous,
      'carried': carried,
      'burden': burden,
      'heart': heart,
      'wrapped': wrapped?.map((item) => item.toJson()).toList(),
      'growths': growths,
      'rank': rank,
    };
  }
}

/// 订单列表显示数据项
class DnpOrderListItemModel {
  /// 标题
  String? discernible;
  
  /// 值
  String? hedge;

  DnpOrderListItemModel({
    this.discernible,
    this.hedge,
  });

  factory DnpOrderListItemModel.fromJson(Map<String, dynamic> json) {
    return DnpOrderListItemModel(
      discernible: json['discernible']?.toString(),
      hedge: json['hedge']?.toString(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'discernible': discernible,
      'hedge': hedge,
    };
  }
}